<?php

class Core_Backend_Component_Global_View_Module_Index extends Core_Backend_Share_View_Grid {

    protected function buildNavigation($navigation) {
        $navigation->addLabel($this->__('global.title.module_index'));
        parent::buildNavigation($navigation);
    }

    protected function buildToolbar($toolbar) {
        parent::buildToolbar($toolbar);
    }

    protected function buildGrid($grid) {
        $grid->setId('module_grid')->setPrimaryKey('id');
        $grid->addLabelColumn($this->__('share.label.name'), 'title', '{title}')
                ->setWidth(200);
        $grid->addLabelColumn($this->__('global.label.author'), 'author', '{author}')
                ->setWidth(200);
        $grid->addLabelColumn($this->__('global.label.company'), 'company', '{company}')
                ->setWidth(200);
        $grid->addLinkColumn($this->__('global.label.website_uri'), 'website_uri', '{website_uri}', '{website_uri}');
        $grid->addLabelColumn($this->__('global.label.version'), 'version', '{version}')
                ->setWidth(200);
        $grid->addLinkColumn('#', 'assign', $this->getUrl(array('id' => '{id}'), 'assign'), $this->__('global.label.assign'))
                ->setWidth(40)
                ->setAlign('center');
        $grid->setDataSource($this->getList()->toArray());
        parent::buildGrid($grid);
    }

    protected function buildPagination($pagination) {
        $pagination->setUrlFormat($this->getPaginationUrl())->setRecordCount($this->getRecords());
        parent::buildPagination($pagination);
    }

}

